#! /usr/bin/ruby
require 'mysql'
require 'lib/mercury/lib/generators/input.rb'

class SimulationRun
	def initialize(simulation_id)
		simulation = Simulation.find(simulation_id)
		system = System.find(simulation.system_id)
		integration_parameters = IntegrationParameter.find(:first, :conditions => { :simulation_id => simulation.id })			
		bodies = SimulationBody.find(:all, :conditions => { :simulation_id => simulation.id })
		Input.write(system, simulation, integration_parameters, bodies)
	end
end
